

#ifndef SAR_LIBRARY_HASH_H
#define SAR_LIBRARY_HASH_H

#include <kernel/kernel.h>

typedef struct HASH {
	char **Keys;
	void **Values;
	size Size;
	size Capacity;
	size ElementSize;
} Hash;


Hash *hash_request (size _element, size _capacity);
void hash_release (Hash *_hash);
int hash_key (const char *_name);
index hash_index (const char *_name);
void *hash_find (Hash *_hash, const char *_name);
void *hash_insert (Hash *_hash, const char *_name);
void hash_remove (Hash *_hash, const char *_name);
void *hash_fast (Hash *_hash, const char *_name, int _key);


/* This hash certainly isn't the fastest implementation in the world; it
 * requires two block_requests for each insert.  However, it is about as
 * good as any other hash for lookups, so it will work for now. */

#endif
